<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
		<title>后台管理</title>
		<link rel="stylesheet" href="lib/layui/css/layui.css">
		<link rel="stylesheet" href="css/login.css">
        <script src="js/vue.js"></script>
        <script src="js/axios.js"></script>
	</head>
    <body class="login-bg">
        <div id="app">
        <div class="login layui-anim layui-anim-up">
            <div class="message">后台管理</div>
            <div id="darkbannerwrap"></div>
            <form  class="layui-form" >
                <input type="text" name="username" placeholder="用户名" v-model="username" lay-verify="required" class="layui-input">
                <hr class="hr15">
                <input type="password" name="password" placeholder="密码" v-model="password" lay-verify="required" class="layui-input">
                <hr class="hr15">
                <input value="登录" lay-submit lay-filter="login" type="button" v-on:click="goLogin">
                <hr class="hr10" >
            </form>
        </div>
        </div>
    </body>
    <script type="text/javascript" >
        var app = new Vue({
            el:"#app",
            data:{
                //String username,String password
                username:"",
                password:""
            },
            methods:{
                goLogin:function () {
                    var that = this;
                    console.log(this.username+"--"+this.password)
                    axios.post("/login?username="+that.username+"&password="+that.password).then(function (res) {

                        if(res.data == "登录成功"){
                            location.href="index.html";
                        }
                    })
                }
            }
        })
    </script>
</html>
<script src="js/jquery-3.4.1.min.js"></script>
<script src="lib/layui/layui.js"></script>

